package com.ruoyi.system.mapper.app;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.system.domain.app.Device;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface DeviceMapper {

    List<Map> indexDeviceDistribute(@Param("operatorId")Long operatorId);

    Map indexDevice(@Param("operatorId")Long operatorId);

    Map indexHole(@Param("operatorId")Long operatorId);

    int deleteByPrimaryKey(Long id);

    int insert(Device record);

    int insertSelective(Device record);

    int updateOperator(@Param("communityId")Long communityId,@Param("operatorId")Long operatorId,
                       @Param("operatorName")String operatorName,@Param("appId")String appId);

    Device selectByPrimaryKey(Long id);

    Device selectByNum(String deviceNum);

    List<Device> getAll(@Param("communityName")String communityName,@Param("appId")String appId);

    List<Long> selectCommunityIdBydeviceNum(String deviceNum);

    Map<String ,Long> selectHoleAmount(Long deviceId);

    List<Device> findDevice(@Param("value")String value,@Param("appId")String appId);

    List<Device> deviceList(@Param("device")Device device);

    int updateByPrimaryKeySelective(Device record);

    int updateByPrimaryKey(Device record);

    int unBindCommunity(Long deviceId);

    int updateLonLat(@Param("longitude")String longitude,@Param("latitude") String latitude,@Param("id") String id );

    int updateByCommunityId(@Param("communityName")String communityName ,@Param("communityId")Long communityId);
}